/* 
 *  javascribd - Java client library for the Scribd API. 
 *  Copyright (C) 2009 by Marcel Eyke, http://code.google.com/p/javascribd/ 
 *  Use is subject to license terms of LGPL. See license.txt. 
 */
package com.google.code.javascribd.type;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;

@XmlEnum
public enum ConversionStatus {

	@XmlEnumValue("DISPLAYABLE")
	DISPLAYABLE("DISPLAYABLE"),

	@XmlEnumValue("DONE")
	DONE("DONE"),

	@XmlEnumValue("ERROR")
	ERROR("ERROR"),

	@XmlEnumValue("PROCESSING")
	PROCESSING("PROCESSING");

	private final String value;

	ConversionStatus(String v) {
		value = v;
	}

	public String value() {
		return value;
	}

	public static ConversionStatus fromValue(String v) {
		for (ConversionStatus c : ConversionStatus.values()) {
			if (c.value.equals(v)) {
				return c;
			}
		}
		throw new IllegalArgumentException(v);
	}

	@Override
	public String toString() {
		return this.value();
	}
}
